package com.kid.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * 配置类，配置注入RestTemplate对象
 */

@Configuration
public class CustomizationBean {


    @Bean
    @LoadBalanced //提供给RestTemplate负载均衡能力，默认是轮询算法
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
